package com.dhecp.project.flowable.mapper;
import com.dhecp.project.flowable.domain.*;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @InterfaceName ActProcessMapper
 * @Description TODO
 * @Author alula
 * @Date 2019-12-03 10:01
 */

public interface ActProcessMapper  {

    //代办任务
    List<ActRuntimeTask> findActTodoRuntimeTask(Map<String, Object> params);

    //已办任务
    List<ActHistoricTask> findActDoneRuntimeTask(Map<String, Object> params);

    //运行中的流程
    List<ActRuntimeInstance> findActRuntimeProcess(Map<String, Object> params);

    //运行中的流程
    List<ActRuntimeInstance> findActRuntimeProcess2(Map<String, Object> params);

    //已完成的流程
    List<ActHistoricInstance> findActFinishProcess(Map<String, Object> params);

    String findActHiIdentitylinkUserId(Map<String, Object> params);

    int insertActHiIdentityLink(Map<String, Object> params);

    int deleteActTaskIdentityLink(@Param("taskId") String taskId);

    int updateActTaskRuExecution(Map<String, Object> params);

    //根据新的流程实例ID更新旧的数据
    int updateActHiTaskProcInstData(Map<String, Object> params);

    //查询用户任务数量
    int findTaskCountByUserId(Map<String, Object> params);

    //根据procInstId查询流程各环节处理信息
    List<ActHistoricActivity> findActHistoricActivityByProcInstId(Map<String, Object> params);

    //绑定企业微信且存在待办任务未发送的用户（排除一分钟内活跃用户）
    List<Map<String, Object>> findUserWithWeChatId();

    //更新待办任务推送企业微信通知标志
    int updateTaskWxSendFlag(Map<String, Object> params);
}
